package com.jxw.test.application.controller;

import com.jxw.test.application.domain.model.DeviceBindRequest;
import com.jxw.test.application.service.DeviceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 设备管理控制层
 */
@RestController
@RequestMapping("/api/device/")
@Slf4j
public class DeviceController {

    @Autowired
    private DeviceService deviceService;

    /**
     * 设备绑定
     * @return
     */
    @PostMapping("/bind")
    public String bind(@RequestBody DeviceBindRequest deviceBindRequest){
        //调用绑定方法
        int result = deviceService.deviceBind(deviceBindRequest);

        return "succ";
    }
}
